//banner分页
function page(ct,size,t){
	var last = $('#lastPage').val();
	if(t=='prev'){
		ct = Number($('#pageNo').val())-1;
	}
	if(t=='next'){
		ct = Number($('#pageNo').val())+1;
	}
	if(t=='search'){
		ct = Number($('#lastPage').val());
	}
	if(ct!=1){
		if(ct<0||ct>last){return ;}//如果不在包含的页数则不变
	}
	$('#pageNo').val(ct);
	$('#pageSize').val(size);
	$.ajax({
		url:$('#pageForm').attr('action'),
		type:"post",
		data:$('#pageForm').serialize(),
		success:function(data){
			var list = data.list;
			var html=("undefined" == typeof listhead?'':listhead);
			$("#pagehtml").html("");
			for (var i = 0; i < list.length; i++) {
				//html = html + pageAppend(list[i]);
				$("#pagehtml").html($("#pagehtml").html()+pageAppend(list[i]));
			}
			var h = data.html;
			h = h.replace('上一页','previous page');
			h = h.replace('下一页','next page');
			h = h.replace('尾页','trailer page');
			h = h.replace('共','common');
			h = h.replace('页','page');
			$("#pagehtml1").html(h);
			$('#lastPage').val(data.countpage);
		}
	});  
}
//点击查找的时候执行的方法
function pageGo(size){
	var last = $("#last").val();
	if(last!=''){
		page(last,size);
	}else{
		alert("选页框不可为空");
	}
}
